FROM 192.168.31.109:5000/my-app-python:v1.0.0

COPY . .
RUN apt-get install ffmpeg -y \
&& /opt/conda/envs/py310/bin/pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN /opt/conda/envs/py310/bin/pip install .

# WORKDIR /app/ai-movie
# RUN ollama pull fit2cloud/llama3-chinese:8b-q8_0
WORKDIR /app/bin
COPY bin/ .
ARG USERNAME
ENV CURRENT_USER=$USERNAME
RUN chown -R ${USERNAME}:${USERNAME} /app/bin/start.sh && chmod a+x /app/bin/start.sh \
    && chown -R ${USERNAME}:${USERNAME} /app/bin/appctl.sh && chmod a+x /app/bin/appctl.sh

ENTRYPOINT ["/bin/bash", "/app/bin/start.sh"]
